package com.tyk.bookstore.back.platform.model.query;

import com.tyk.bookstore.back.platform.model.constant.SystemSettingValidateConstant;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author tyk
 * @description 系统设置
 */
@Data
@Schema(name = "SystemSettingAddQuery", description = "系统设置")
public class SystemSettingAddQuery implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "变量名")
    @NotBlank
    @Size(min = SystemSettingValidateConstant.NAME_MIN_LENGTH, max = SystemSettingValidateConstant.NAME_MAX_LENGTH)
    @Pattern(regexp = SystemSettingValidateConstant.NAME_REGEXP)
    private String name;

    @Schema(description = "变量值")
    @NotBlank
    @Size(min = SystemSettingValidateConstant.VALUE_MIN_LENGTH, max = SystemSettingValidateConstant.VALUE_MAX_LENGTH)
    @Pattern(regexp = SystemSettingValidateConstant.VALUE_REGEXP)
    private String value;

    @Schema(description = "描述")
    @NotBlank
    @Size(min = SystemSettingValidateConstant.DESCRIPTION_MIN_LENGTH, max = SystemSettingValidateConstant.DESCRIPTION_MAX_LENGTH)
    @Pattern(regexp = SystemSettingValidateConstant.DESCRIPTION_REGEXP)
    private String description;

}
